[TOOLS] Check for python-devel.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 22 Nov 2006 10:30:05 +0000 (10:30 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 22 Nov 2006 10:30:05 +0000 (10:30 +0000)
Thanks to Ewan Mellor, Anthony Liguori, and Daniel P. Berrange for
pointing out problems with and solutions for the problems with the
first version.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
tools/check/check_python_devel [new file with mode: 0755]

diff --git a/tools/check/check_python_devel b/tools/check/check_python_devel
new file mode 100755 (executable)
index 0000000..1074f4c
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+# CHECK-BUILD
+
+function error {
+    echo
+    echo "  *** Check for python development environment FAILED"
+    exit 1
+}
+
+python -c '
+import os.path, sys
+for p in sys.path:
+       if os.path.exists(p + "/config/Makefile"):
+               sys.exit(0)
+sys.exit(1)
+' || error